package com.chis.esjob;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;

public class MyJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        switch (shardingContext.getShardingItem()) {
            case 0:
                System.out.println("do something by sharding item 0");
                // do something by sharding item 0
                break;
            case 1:
                System.out.println("do something by sharding item 1");
                // do something by sharding item 1
                break;
            case 2:
                System.out.println("do something by sharding item 2");
                // do something by sharding item 2
                break;
            // case n: ...
        }
    }
}
